﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CommonClasses;

using System.Windows.Forms;

namespace CommonClasses
{
    /// <summary>
    /// Класс - заменитель реального исполнителя команд при тестировании.
    /// </summary>
    public class MockConnection : IConnection
    {
        string name = "MockConnection";

        public MockConnection(string name)
        {
            this.name = name;
        }

        #region IConnection Members

        public event PinStateChangedHandler OnPinStateChanged;

        public void OnPin(int VirtualPinOut, int signal)
        {
            //Console.WriteLine(name + ".OnPin(" + VirtualPinOut.ToString() + ", " + signal.ToString() + ");");
        }

        public bool MatchRange(int VirtualPin)
        {
            return true;
        }

        public void FlushPins()
        {
            Console.WriteLine(name + ".FlushPins");
        }

        public void Dispose()
        {
            Console.WriteLine(name + ".Clear");
        }

        #endregion
    }
}
